<HTML> <HEAD> <TITLE>NullExample.java</TITLE> </HEAD> <BODY> <PRE> 
<FONT COLOR=Purple>public</FONT> <FONT COLOR=Purple>class</FONT> <FONT COLOR=ForestGreen>NullExample</FONT>
{
    <FONT COLOR=ForestGreen>int</FONT> <FONT COLOR=Blue>foo</FONT>(<FONT COLOR=ForestGreen>Object</FONT> <FONT COLOR=DarkGoldenrod>o</FONT>, <FONT COLOR=ForestGreen>String</FONT> <FONT COLOR=DarkGoldenrod>p</FONT>)
    {
        <FONT COLOR=Purple>if</FONT> (o == <FONT COLOR=CadetBlue>null</FONT>)
        {
            <FONT COLOR=Purple>return</FONT> 2;
        }
        <FONT COLOR=ForestGreen>int</FONT> <FONT COLOR=DarkGoldenrod>i</FONT> = 2;
        i += p.length();
        System.out.println(p);
        <FONT COLOR=Purple>return</FONT> 4;
    }
}
</PRE> </BODY> </HTML>